package com.cby.android.sample.fragments

import com.cby.android.library.base.BaseTabFragment

/**
 * @description: SquareFragment
 * @author: ChenBaoYang
 * @createDate: 2022/5/9 5:45 下午
 */
class SquareFragment : BaseTabFragment() {


    private val list = mutableListOf<String>()

    override fun loadData() {
        for (it in list) {
            pagerAdapter.addFragment(
                SquareListFragment.newInstance(it), it
            )
        }
        pagerAdapter.notifyDataSetChanged()
        viewPager.offscreenPageLimit = list.size
        tabLayout.setupWithViewPager(viewPager)
    }

    override fun onDataInit() {
        list.add("美女")
        list.add("帅哥")
        list.add("豪车")
        list.add("风景")
        list.add("二次元")
        list.add("壁纸")
        list.add("星空")

    }
}